package com.yky.action.admin;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.beans.factory.annotation.Autowired;

import com.yky.action.base.BaseActionSupport;
import com.yky.entity.Organization;
import com.yky.entity.Project;
import com.yky.entity.ProjectEthic;
import com.yky.entity.ProjectEthicVersion;
import com.yky.entity.ProjectGroup;
import com.yky.entity.ProjectGroupVersion;
import com.yky.entity.ProjectIndicator;
import com.yky.entity.ProjectIndicatorVersion;
import com.yky.entity.ProjectOrganization;
import com.yky.entity.ProjectOrganizationVersion;
import com.yky.entity.ProjectReport;
import com.yky.entity.ProjectSummarize;
import com.yky.entity.ProjectVersion;
import com.yky.entity.Province;
import com.yky.entity.User;
import com.yky.model.ProjectEntity;
import com.yky.service.admin.ProjectEthicService;
import com.yky.service.admin.ProjectEthicVersionService;
import com.yky.service.admin.ProjectGroupService;
import com.yky.service.admin.ProjectGroupVersionService;
import com.yky.service.admin.ProjectIndicatorService;
import com.yky.service.admin.ProjectIndicatorVersionService;
import com.yky.service.admin.ProjectOrganizationService;
import com.yky.service.admin.ProjectOrganizationVersionService;
import com.yky.service.admin.ProjectService;
import com.yky.service.admin.ProjectSummarizeService;
import com.yky.service.admin.ProjectVersionService;
import com.yky.service.admin.ProvinceService;
import com.yky.utils.JsonUtil;
import com.yky.utils.base.DateUtils;

/**
 * 项目检索
 * 
 * @author vimesly
 * 
 */

@ParentPackage("perInterceptor")
@InterceptorRefs({@InterceptorRef("sessionStack")})
@Namespace(value = "/admin/project")
@Results( {
		@Result(name = "project_list", type = "redirect", location = "/admin/project/project_list.jsp"),
		@Result(name = "project_version", type = "redirect", location = "/admin/project/project_version.jsp") })
public class ProjectAction extends BaseActionSupport {

	private static final long serialVersionUID = 1L;

	private Integer id;
	private Integer versionId;

	private Integer versionId1;
	private Integer versionId2;

	private String regNumber; // 注册号 CMR-20150308-1006 只有审核通过后才分配注册号
	private String name;
	private String keywords;
	private String sourceType;
	private String sourceTypeSec;
	private String sponsors;
	// 项目组织信息
	private String principalName;
	private String principaCertificateType;
	private String principaCertificateNumber;
	private String principaTelephone;
	private String principaPhone;
	private String principaEmail;
	// 伦理审查信息
	private String ethicName;
	private String isRecords;
	private String provinceCode;
	private String auditDate;
	private String approvalNumber;
	private String ethicTelephone;
	private String ethicEmail;
	private String approvalFilePath;
	// 研究设计信息
	private String researchPurpose;
	private String researchScheme;
	private String researchType;
	private String researchDesignTimer;
	private String researchTypeInfo;
	// 组别
	private String[] groupName;
	private String[] groupConditions;
	private String[] interventionType;
	private String[] interventionMeasures;

	private String researchDesignStart;
	private String researchDesignEnd;
	private String researchDomain;
	private String researchDomainSec;
	// 主要结局指标
	private String indicatorNameMain;
	private String indicatorDescriptionMain;
	private String indicatorTypeMain;
	// 次要结局指标
	private String[] indicatorNameMinor;
	private String[] indicatorDescriptionMinor;
	private String[] indicatorTypeMinor;
	// 其他
	private String[] indicatorNameElse;
	private String[] indicatorDescriptionElse;
	private String[] indicatorTypeElse;

	// 研究对象
	private String researchObjectInfo;
	private String researchObjectSample;
	private String inclusionCriteria;
	private String exclusionCriteria;
	private String sexPreference;
	private String minAge;
	private String maxAge;
	private String researchObjectStatus;
	private String researchObjectStart;
	private String researchObjectEnd;
	private String sampleType;
	private String sampleInfo;
	// 其他信息
	private String websiteName; // 主页名称
	private String websiteUrl; // 主页网址
	private String thesisType; // 项目发表论著类型
	private String thesisFilePath; // 项目主发表论著(pdf)文件上传
	
	private String isStemCellProjects; //是否为干细胞项目

	// 提交类型
	private String submitType; // 0-保存 1-提交

	private String searchText;
	private String searchStatus;

	private String reason; // 原因
	private String status; // 状态 (-1=草稿 0-待审核 1-审核通过 2-审核不通过)

	private Project project;
	private ProjectEthic projectEthic;
	private ProjectGroup projectGroup;
	private ProjectIndicator projectIndicator;
	private ProjectReport projectReport;
	private ProjectSummarize projectSummarize;
	private ProjectOrganization projectOrganization;

	@Autowired
	private ProvinceService provinceService;
	@Autowired
	private ProjectService projectService;
	@Autowired
	private ProjectEthicService projectEthicService;
	@Autowired
	private ProjectGroupService projectGroupService;
	@Autowired
	private ProjectIndicatorService projectIndicatorService;
	@Autowired
	private ProjectOrganizationService projectOrganizationService;

	@Autowired
	private ProjectVersionService projectVersionService;
	@Autowired
	private ProjectEthicVersionService projectEthicVersionService;
	@Autowired
	private ProjectGroupVersionService projectGroupVersionService;
	@Autowired
	private ProjectIndicatorVersionService projectIndicatorVersionService;
	@Autowired
	private ProjectOrganizationVersionService projectOrganizationVersionService;
	@Autowired
	private ProjectSummarizeService projectSummarizeService;

	public String getProjectVersionInfo() {
		try {
			HashMap<String, Object> r = new LinkedHashMap<String, Object>();
			// 版本项目1
			ProjectVersion projectVersion1 = projectVersionService
					.find(versionId1);
			r.put("projectVersion1", projectVersion1);
			// 项目组织信息
			List<ProjectOrganizationVersion> poList1 = projectOrganizationVersionService
					.findByPropertys("o.projectVersion=?",
							new Object[] { projectVersion1 });
			if (poList1.size() > 0) {
				r.put("projectOrganizationVersion1", poList1.get(0));
			}
			// 伦理审查信息
			List<ProjectEthicVersion> peList1 = projectEthicVersionService
					.findByPropertys("o.projectVersion=?",
							new Object[] { projectVersion1 });
			if (peList1.size() > 0) {
				Province province = provinceService.find(peList1.get(0)
						.getProvinceCode());
				r.put("projectEthicProvinceName1", province.getName());
				r.put("projectEthicVersion1", peList1.get(0));
			}
			// 组信息
			List<ProjectGroupVersion> pgList1 = projectGroupVersionService
					.findByPropertys("o.projectVersion=?",
							new Object[] { projectVersion1 });
			r.put("projectGroupVersionList1", pgList1);
			// 主要结局信息
			List<ProjectIndicatorVersion> piListMain1 = projectIndicatorVersionService
					.findByPropertys("o.projectVersion=? and o.type=?",
							new Object[] { projectVersion1, "0" });
			if (piListMain1.size() > 0) {
				r.put("projectIndicatorMainVersion1", piListMain1.get(0));
			}
			// 次要结局信息
			List<ProjectIndicatorVersion> piListMinor1 = projectIndicatorVersionService
					.findByPropertys("o.projectVersion=? and o.type=?",
							new Object[] { projectVersion1, "1" });
			r.put("projectIndicatorListMinorVersion1", piListMinor1);
			// 其他结局信息
			List<ProjectIndicatorVersion> piListElse1 = projectIndicatorVersionService
					.findByPropertys("o.projectVersion=? and o.type=?",
							new Object[] { projectVersion1, "2" });
			r.put("projectIndicatorListElseVersion1", piListElse1);

			// 版本项目2
			ProjectVersion projectVersion2 = projectVersionService
					.find(versionId2);
			r.put("projectVersion2", projectVersion2);
			// 项目组织信息
			List<ProjectOrganizationVersion> poList2 = projectOrganizationVersionService
					.findByPropertys("o.projectVersion=?",
							new Object[] { projectVersion2 });
			if (poList2.size() > 0) {
				r.put("projectOrganizationVersion2", poList2.get(0));
			}
			// 伦理审查信息
			List<ProjectEthicVersion> peList2 = projectEthicVersionService
					.findByPropertys("o.projectVersion=?",
							new Object[] { projectVersion2 });
			if (peList2.size() > 0) {
				Province province = provinceService.find(peList2.get(0)
						.getProvinceCode());
				r.put("projectEthicProvinceName2", province.getName());
				r.put("projectEthicVersion2", peList2.get(0));
			}
			// 组信息
			List<ProjectGroupVersion> pgList2 = projectGroupVersionService
					.findByPropertys("o.projectVersion=?",
							new Object[] { projectVersion2 });
			r.put("projectGroupVersionList2", pgList2);
			// 主要结局信息
			List<ProjectIndicatorVersion> piListMain2 = projectIndicatorVersionService
					.findByPropertys("o.projectVersion=? and o.type=?",
							new Object[] { projectVersion2, "0" });
			if (piListMain2.size() > 0) {
				r.put("projectIndicatorMainVersion2", piListMain2.get(0));
			}
			// 次要结局信息
			List<ProjectIndicatorVersion> piListMinor2 = projectIndicatorVersionService
					.findByPropertys("o.projectVersion=? and o.type=?",
							new Object[] { projectVersion2, "1" });
			r.put("projectIndicatorListMinorVersion2", piListMinor2);
			// 其他结局信息
			List<ProjectIndicatorVersion> piListElse2 = projectIndicatorVersionService
					.findByPropertys("o.projectVersion=? and o.type=?",
							new Object[] { projectVersion2, "2" });
			r.put("projectIndicatorListElseVersion2", piListElse2);
			super.printWriterJsonToPage(JsonUtil.formatToJson(r));
		} catch (Exception e) {
			// TODO: handle exception
		}
		return null;
	}

	// 获得机构信息
	public String getOrganizationInfo() {
		try {
			HashMap<String, Object> r = new LinkedHashMap<String, Object>();
			HttpServletRequest request = ServletActionContext.getRequest();
			User user = (User) request.getSession(false).getAttribute("user");
			Organization aOrganization = user.getOrganization();
			Province aProvince = provinceService.find(aOrganization
					.getProvince().getCode());
			r.put("organization", aOrganization);
			r.put("province", aProvince);
			super.printWriterJsonToPage(JsonUtil.formatToJson(r));
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return null;
	}

	// 项目版本列表
	public String getProjectVersionList() {
		HttpServletRequest request = ServletActionContext.getRequest();
		User user = (User) request.getSession(false).getAttribute("user");
		HashMap<String, Object> r = new LinkedHashMap<String, Object>();
		try {
			if (user != null) {
				project = projectService.find(id);
				r.put("projectName", project.getName());
				LinkedHashMap<String, String> orderby = new LinkedHashMap<String, String>();
				orderby.put("versionNumber", "desc");
				List<ProjectVersion> versionList = projectVersionService
						.findByPropertys("o.project=?",
								new Object[] { project }, orderby);
				r.put("list", versionList);
				super.printWriterJsonToPage(JsonUtil.formatToJson(r));
			}
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return null;
	}

	// 提交项目变更版本信息
	public String versionEdit() {
		HttpServletRequest request = ServletActionContext.getRequest();
		User user = (User) request.getSession(false).getAttribute("user");
		try {
			if (user != null) {
				project = projectService.find(id);
				if (!"1".equals(project.getStatus())) {
					// 只有已通过的项目才能提交新版本
					return null;
				}
				// version 开始
				ProjectVersion projectVersion = new ProjectVersion();
				projectVersion.setName(name);
				projectVersion.setKeywords(keywords);
				projectVersion.setSourceType(sourceType);
				projectVersion.setSourceTypeSec(sourceTypeSec);
				projectVersion.setSponsors(sponsors);
				projectVersion.setOrganization(user.getOrganization());
				projectVersion.setResearchPurpose(researchPurpose);
				projectVersion.setResearchScheme(researchScheme);
				projectVersion.setResearchType(researchType);
				if ("观察性研究".equals(researchType)) {
					projectVersion.setResearchDesignTimer(researchDesignTimer);
				} else if ("其他".equals(researchType)) {
					projectVersion.setResearchTypeInfo(researchTypeInfo);
				}
				projectVersion.setResearchDesignStart(researchDesignStart);
				projectVersion.setResearchDesignEnd(researchDesignEnd);
				projectVersion.setResearchDomain(researchDomain);
				projectVersion.setResearchDomainSec(researchDomainSec);
				projectVersion.setResearchObjectInfo(researchObjectInfo);
				projectVersion.setResearchObjectSample(researchObjectSample);
				projectVersion.setInclusionCriteria(inclusionCriteria);
				projectVersion.setExclusionCriteria(exclusionCriteria);
				projectVersion.setSexPreference(sexPreference);
				projectVersion.setMinAge(minAge);
				projectVersion.setMaxAge(maxAge);
				projectVersion.setResearchObjectStatus(researchObjectStatus);
				projectVersion.setResearchObjectStart(researchObjectStart);
				projectVersion.setResearchObjectEnd(researchObjectEnd);
				projectVersion.setSampleType(sampleType);
				projectVersion.setSampleInfo(sampleInfo);
				projectVersion.setWebsiteName(websiteName);
				projectVersion.setWebsiteUrl(websiteUrl);
				projectVersion.setThesisType(thesisType);
				projectVersion.setThesisFilePath(thesisFilePath);
				projectVersion.setStatus("0");
				// 版本相关信息
				projectVersion.setVersionTime(DateUtils.getDateTime());
				// 查询版本号
				LinkedHashMap<String, String> orderby = new LinkedHashMap<String, String>();
				orderby.put("versionNumber", "desc");
				List<ProjectVersion> pvList = projectVersionService
						.findByPropertys("o.project=?",
								new Object[] { project }, orderby);
				if (pvList.size() > 0) {
					projectVersion.setVersionNumber((Integer.parseInt(pvList
							.get(0).getVersionNumber()) + 1)
							+ "");
				} else {
					projectVersion.setVersionNumber("1");
				}
				projectVersion.setVersionStatus("0");
				projectVersion.setProject(project);
				projectVersion.setRegNumber(project.getRegNumber());
				projectVersion.setCreateTime(project.getCreateTime());
				projectVersion.setCreateUser(project.getCreateUser());
				projectVersionService.saveEntity(projectVersion);

				// 项目组织信息
				ProjectOrganizationVersion aProjectOrganizationVersion = new ProjectOrganizationVersion();
				aProjectOrganizationVersion.setProject(project);
				aProjectOrganizationVersion.setProjectVersion(projectVersion);
				aProjectOrganizationVersion.setPrincipalName(principalName);
				aProjectOrganizationVersion
						.setPrincipaCertificateType(principaCertificateType);
				aProjectOrganizationVersion
						.setPrincipaCertificateNumber(principaCertificateNumber);
				aProjectOrganizationVersion
						.setPrincipaTelephone(principaTelephone);
				aProjectOrganizationVersion.setPrincipaPhone(principaPhone);
				aProjectOrganizationVersion.setPrincipaEmail(principaEmail);
				projectOrganizationVersionService
						.saveEntity(aProjectOrganizationVersion);

				// 伦理审查信息
				ProjectEthicVersion aProjectEthicVersion = new ProjectEthicVersion();
				aProjectEthicVersion.setName(ethicName);
				aProjectEthicVersion.setIsRecords(isRecords);
				aProjectEthicVersion.setProvinceCode(provinceCode);
				aProjectEthicVersion.setAuditDate(auditDate);
				aProjectEthicVersion.setApprovalNumber(approvalNumber);
				aProjectEthicVersion.setTelephone(ethicTelephone);
				aProjectEthicVersion.setEmail(ethicEmail);
				aProjectEthicVersion.setApprovalFilePath(approvalFilePath);
				aProjectEthicVersion.setProject(project);
				aProjectEthicVersion.setProjectVersion(projectVersion);
				projectEthicVersionService.saveEntity(aProjectEthicVersion);

				if ("干预性研究".equals(researchType)) {
					// 组别信息 多值
					if (groupName != null && groupName.length > 0) {
						for (int i = 0; i < groupName.length; i++) {
							ProjectGroupVersion aProjectGroupVersion = new ProjectGroupVersion();
							aProjectGroupVersion.setGroupName(groupName[i]);
							aProjectGroupVersion
									.setGroupConditions(groupConditions[i]);
							aProjectGroupVersion
									.setInterventionType(interventionType[i]);
							aProjectGroupVersion
									.setInterventionMeasures(interventionMeasures[i]);
							aProjectGroupVersion.setProject(project);
							aProjectGroupVersion
									.setProjectVersion(projectVersion);
							projectGroupVersionService
									.saveEntity(aProjectGroupVersion);
						}
					}
				}

				// 主要结局指标
				ProjectIndicatorVersion aProjectIndicatorVersion = new ProjectIndicatorVersion();
				aProjectIndicatorVersion.setType("0");
				aProjectIndicatorVersion.setIndicatorName(indicatorNameMain);
				aProjectIndicatorVersion
						.setIndicatorDescription(indicatorDescriptionMain);
				aProjectIndicatorVersion.setIndicatorType(indicatorTypeMain);
				aProjectIndicatorVersion.setProject(project);
				aProjectIndicatorVersion.setProjectVersion(projectVersion);
				projectIndicatorVersionService
						.saveEntity(aProjectIndicatorVersion);

				// 次要结局指标
				if (indicatorNameMinor != null && indicatorNameMinor.length > 0) {
					for (int i = 0; i < indicatorNameMinor.length; i++) {
						aProjectIndicatorVersion = new ProjectIndicatorVersion();
						aProjectIndicatorVersion.setType("1");
						aProjectIndicatorVersion
								.setIndicatorName(indicatorNameMinor[i]);
						aProjectIndicatorVersion
								.setIndicatorDescription(indicatorDescriptionMinor[i]);
						aProjectIndicatorVersion
								.setIndicatorType(indicatorTypeMinor[i]);
						aProjectIndicatorVersion.setProject(project);
						aProjectIndicatorVersion
								.setProjectVersion(projectVersion);
						projectIndicatorVersionService
								.saveEntity(aProjectIndicatorVersion);
					}
				}
				// 其他结局指标
				if (indicatorNameElse != null && indicatorNameElse.length > 0) {
					for (int i = 0; i < indicatorNameElse.length; i++) {
						aProjectIndicatorVersion = new ProjectIndicatorVersion();
						aProjectIndicatorVersion.setType("2");
						aProjectIndicatorVersion
								.setIndicatorName(indicatorNameElse[i]);
						aProjectIndicatorVersion
								.setIndicatorDescription(indicatorDescriptionElse[i]);
						aProjectIndicatorVersion
								.setIndicatorType(indicatorTypeElse[i]);
						aProjectIndicatorVersion.setProject(project);
						aProjectIndicatorVersion
								.setProjectVersion(projectVersion);
						projectIndicatorVersionService
								.saveEntity(aProjectIndicatorVersion);
					}
				}

				//

			}
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return "project_list";
	}

	public String edit() {
		HttpServletRequest request = ServletActionContext.getRequest();
		User user = (User) request.getSession(false).getAttribute("user");
		System.out.println("isStemCellProjects=" + isStemCellProjects);
		try {
			if (user != null) {
				project = projectService.find(id);
				if ("0".equals(project.getStatus())
						|| "1".equals(project.getStatus())) {
					// 待审核或者已通过不能进行编辑
					return null;
				}
				project.setName(name);
				project.setKeywords(keywords);
				project.setSourceType(sourceType);
				project.setSourceTypeSec(sourceTypeSec);
				project.setSponsors(sponsors);
				project.setOrganization(user.getOrganization());
				project.setResearchPurpose(researchPurpose);
				project.setResearchScheme(researchScheme);
				project.setResearchType(researchType);
				if ("观察性研究".equals(researchType)) {
					project.setResearchDesignTimer(researchDesignTimer);
				} else if ("其他".equals(researchType)) {
					project.setResearchTypeInfo(researchTypeInfo);
				}
				project.setResearchDesignStart(researchDesignStart);
				project.setResearchDesignEnd(researchDesignEnd);
				project.setResearchDomain(researchDomain);
				project.setResearchDomainSec(researchDomainSec);
				project.setResearchObjectInfo(researchObjectInfo);
				project.setResearchObjectSample(researchObjectSample);
				project.setInclusionCriteria(inclusionCriteria);
				project.setExclusionCriteria(exclusionCriteria);
				project.setSexPreference(sexPreference);
				project.setMinAge(minAge);
				project.setMaxAge(maxAge);
				project.setResearchObjectStatus(researchObjectStatus);
				project.setResearchObjectStart(researchObjectStart);
				project.setResearchObjectEnd(researchObjectEnd);
				project.setSampleType(sampleType);
				project.setSampleInfo(sampleInfo);
				project.setWebsiteName(websiteName);
				project.setWebsiteUrl(websiteUrl);
				project.setThesisType(thesisType);
				project.setThesisFilePath(thesisFilePath);
				project.setIsStemCellProjects(isStemCellProjects);
				if ("0".equals(submitType)) {
					// 保存草稿
					project.setStatus("-1");
				} else {
					// 提交信息
					project.setStatus("0");
				}
				projectService.updateEntity(project);
				// 项目组织信息
				List<ProjectOrganization> poList = projectOrganizationService
						.findByPropertys("o.project=?",
								new Object[] { project });
				if (poList.size() > 0) {
					projectOrganization = poList.get(0);
					projectOrganization.setProject(project);
					projectOrganization.setPrincipalName(principalName);
					projectOrganization
							.setPrincipaCertificateType(principaCertificateType);
					projectOrganization
							.setPrincipaCertificateNumber(principaCertificateNumber);
					projectOrganization.setPrincipaTelephone(principaTelephone);
					projectOrganization.setPrincipaPhone(principaPhone);
					projectOrganization.setPrincipaEmail(principaEmail);
					projectOrganizationService
							.updateEntity(projectOrganization);
				}

				// 伦理审查信息
				List<ProjectEthic> peList = projectEthicService
						.findByPropertys("o.project=?",
								new Object[] { project });
				if (peList.size() > 0) {
					projectEthic = peList.get(0);
					projectEthic.setName(ethicName);
					projectEthic.setIsRecords(isRecords);
					projectEthic.setProvinceCode(provinceCode);
					projectEthic.setAuditDate(auditDate);
					projectEthic.setApprovalNumber(approvalNumber);
					projectEthic.setTelephone(ethicTelephone);
					projectEthic.setEmail(ethicEmail);
					projectEthic.setApprovalFilePath(approvalFilePath);
					projectEthic.setProject(project);
					projectEthicService.updateEntity(projectEthic);
				}

				if ("干预性研究".equals(researchType)) {
					// 组别信息 多值

					// 删除组信息
					List<ProjectGroup> pgList = projectGroupService
							.findByPropertys("o.project=?",
									new Object[] { project });
					for (int i = 0; i < pgList.size(); i++) {
						projectGroupService.deleteEntity(pgList.get(i).getId());
					}

					if (groupName != null && groupName.length > 0) {
						for (int i = 0; i < groupName.length; i++) {
							projectGroup = new ProjectGroup();
							projectGroup.setGroupName(groupName[i]);
							projectGroup.setGroupConditions(groupConditions[i]);
							projectGroup
									.setInterventionType(interventionType[i]);
							projectGroup
									.setInterventionMeasures(interventionMeasures[i]);
							projectGroup.setProject(project);
							projectGroupService.saveEntity(projectGroup);
						}
					}
				}

				// 删除结局信息
				List<ProjectIndicator> piList = projectIndicatorService
						.findByPropertys("o.project=?",
								new Object[] { project });
				for (int i = 0; i < piList.size(); i++) {
					projectIndicatorService.deleteEntity(piList.get(i).getId());
				}

				// 主要结局指标
				projectIndicator = new ProjectIndicator();
				projectIndicator.setType("0");
				projectIndicator.setIndicatorName(indicatorNameMain);
				projectIndicator
						.setIndicatorDescription(indicatorDescriptionMain);
				projectIndicator.setIndicatorType(indicatorTypeMain);
				projectIndicator.setProject(project);
				projectIndicatorService.saveEntity(projectIndicator);
				// 次要结局指标
				if (indicatorNameMinor != null && indicatorNameMinor.length > 0) {
					for (int i = 0; i < indicatorNameMinor.length; i++) {
						projectIndicator = new ProjectIndicator();
						projectIndicator.setType("1");
						projectIndicator
								.setIndicatorName(indicatorNameMinor[i]);
						projectIndicator
								.setIndicatorDescription(indicatorDescriptionMinor[i]);
						projectIndicator
								.setIndicatorType(indicatorTypeMinor[i]);
						projectIndicator.setProject(project);
						projectIndicatorService.saveEntity(projectIndicator);
					}
				}
				// 其他结局指标
				if (indicatorNameElse != null && indicatorNameElse.length > 0) {
					for (int i = 0; i < indicatorNameElse.length; i++) {
						projectIndicator = new ProjectIndicator();
						projectIndicator.setType("2");
						projectIndicator.setIndicatorName(indicatorNameElse[i]);
						projectIndicator
								.setIndicatorDescription(indicatorDescriptionElse[i]);
						projectIndicator.setIndicatorType(indicatorTypeElse[i]);
						projectIndicator.setProject(project);
						projectIndicatorService.saveEntity(projectIndicator);
					}
				}
				// 
			}
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return "project_list";
	}

	// 查询版本信息
	public String findVersion() {
		HttpServletRequest request = ServletActionContext.getRequest();
		User user = (User) request.getSession(false).getAttribute("user");
		if (user != null) {
			HashMap<String, Object> r = new LinkedHashMap<String, Object>();
			try {
				ProjectVersion projectVersion = projectVersionService
						.find(versionId);
				r.put("projectVersion", projectVersion);
				// 项目组织信息
				List<ProjectOrganizationVersion> poList = projectOrganizationVersionService
						.findByPropertys("o.projectVersion=?",
								new Object[] { projectVersion });
				if (poList.size() > 0) {
					r.put("projectOrganizationVersion", poList.get(0));
				}
				// 伦理审查信息
				List<ProjectEthicVersion> peList = projectEthicVersionService
						.findByPropertys("o.projectVersion=?",
								new Object[] { projectVersion });
				if (peList.size() > 0) {
					Province province = provinceService.find(peList.get(0)
							.getProvinceCode());
					r.put("projectEthicProvinceName", province.getName());
					r.put("projectEthicVersion", peList.get(0));
				}
				// 组信息
				List<ProjectGroupVersion> pgList = projectGroupVersionService
						.findByPropertys("o.projectVersion=?",
								new Object[] { projectVersion });
				r.put("projectGroupVersionList", pgList);
				// 主要结局信息
				List<ProjectIndicatorVersion> piListMain = projectIndicatorVersionService
						.findByPropertys("o.projectVersion=? and o.type=?",
								new Object[] { projectVersion, "0" });
				if (piListMain.size() > 0) {
					r.put("projectIndicatorMainVersion", piListMain.get(0));
				}
				// 次要结局信息
				List<ProjectIndicatorVersion> piListMinor = projectIndicatorVersionService
						.findByPropertys("o.projectVersion=? and o.type=?",
								new Object[] { projectVersion, "1" });
				r.put("projectIndicatorListMinorVersion", piListMinor);
				// 其他结局信息
				List<ProjectIndicatorVersion> piListElse = projectIndicatorVersionService
						.findByPropertys("o.projectVersion=? and o.type=?",
								new Object[] { projectVersion, "2" });
				r.put("projectIndicatorListElseVersion", piListElse);

				super.printWriterJsonToPage(JsonUtil.formatToJson(r));
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return null;
	}

	public String find() {
		HttpServletRequest request = ServletActionContext.getRequest();
		User user = (User) request.getSession(false).getAttribute("user");
		if (user != null) {
			HashMap<String, Object> r = new LinkedHashMap<String, Object>();
			try {
				project = projectService.find(id);
				if ("0".equals(project.getStatus())) {
					// 待审核或者已通过不能进行编辑
					return null;
				}
				r.put("project", project);
				// 项目组织信息
				List<ProjectOrganization> poList = projectOrganizationService
						.findByPropertys("o.project=?",
								new Object[] { project });
				if (poList.size() > 0) {
					r.put("projectOrganization", poList.get(0));
				}
				// 伦理审查信息
				List<ProjectEthic> peList = projectEthicService
						.findByPropertys("o.project=?",
								new Object[] { project });
				if (peList.size() > 0) {
					r.put("projectEthic", peList.get(0));
				}
				// 组信息
				List<ProjectGroup> pgList = projectGroupService
						.findByPropertys("o.project=?",
								new Object[] { project });
				r.put("projectGroupList", pgList);
				// 主要结局信息
				List<ProjectIndicator> piListMain = projectIndicatorService
						.findByPropertys("o.project=? and o.type=?",
								new Object[] { project, "0" });
				if (piListMain.size() > 0) {
					r.put("projectIndicatorMain", piListMain.get(0));
				}
				// 次要结局信息
				List<ProjectIndicator> piListMinor = projectIndicatorService
						.findByPropertys("o.project=? and o.type=?",
								new Object[] { project, "1" });
				r.put("projectIndicatorListMinor", piListMinor);
				// 其他结局信息
				List<ProjectIndicator> piListElse = projectIndicatorService
						.findByPropertys("o.project=? and o.type=?",
								new Object[] { project, "2" });
				r.put("projectIndicatorListElse", piListElse);

				super.printWriterJsonToPage(JsonUtil.formatToJson(r));
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return null;
	}

	public String delete() throws Exception {
		HttpServletRequest request = ServletActionContext.getRequest();
		User user = (User) request.getSession(false).getAttribute("user");
		if (user != null) {
			project = projectService.find(id);
			// 删除项目组织信息
			List<ProjectOrganization> poList = projectOrganizationService
					.findByPropertys("o.project=?", new Object[] { project });
			for (int i = 0; i < poList.size(); i++) {
				projectOrganizationService.deleteEntity(poList.get(i).getId());
			}
			// 删除伦理审查信息
			List<ProjectEthic> peList = projectEthicService.findByPropertys(
					"o.project=?", new Object[] { project });
			for (int i = 0; i < peList.size(); i++) {
				projectEthicService.deleteEntity(peList.get(i).getId());
			}
			// 删除组信息
			List<ProjectGroup> pgList = projectGroupService.findByPropertys(
					"o.project=?", new Object[] { project });
			for (int i = 0; i < pgList.size(); i++) {
				projectGroupService.deleteEntity(pgList.get(i).getId());
			}
			// 删除结局信息
			List<ProjectIndicator> piList = projectIndicatorService
					.findByPropertys("o.project=?", new Object[] { project });
			for (int i = 0; i < piList.size(); i++) {
				projectIndicatorService.deleteEntity(piList.get(i).getId());
			}
			// 优先删除关联表信息
			projectService.deleteEntity(id);
		}
		super.pringWriterToPage("success");
		return null;
	}

	public String add() {
		HttpServletRequest request = ServletActionContext.getRequest();
		User user = (User) request.getSession(false).getAttribute("user");
		try {
			if (user != null) {
				project = new Project();
				project.setName(name);
				project.setKeywords(keywords);
				project.setSourceType(sourceType);
				project.setSourceTypeSec(sourceTypeSec);
				project.setSponsors(sponsors);
				project.setOrganization(user.getOrganization());
				project.setResearchPurpose(researchPurpose);
				project.setResearchScheme(researchScheme);
				project.setResearchType(researchType);
				if ("观察性研究".equals(researchType)) {
					project.setResearchDesignTimer(researchDesignTimer);
				} else if ("其他".equals(researchType)) {
					project.setResearchTypeInfo(researchTypeInfo);
				}
				project.setResearchDesignStart(researchDesignStart);
				project.setResearchDesignEnd(researchDesignEnd);
				project.setResearchDomain(researchDomain);
				project.setResearchDomainSec(researchDomainSec);
				project.setResearchObjectInfo(researchObjectInfo);
				project.setResearchObjectSample(researchObjectSample);
				project.setInclusionCriteria(inclusionCriteria);
				project.setExclusionCriteria(exclusionCriteria);
				project.setSexPreference(sexPreference);
				project.setMinAge(minAge);
				project.setMaxAge(maxAge);
				project.setResearchObjectStatus(researchObjectStatus);
				project.setResearchObjectStart(researchObjectStart);
				project.setResearchObjectEnd(researchObjectEnd);
				project.setSampleType(sampleType);
				project.setSampleInfo(sampleInfo);
				project.setWebsiteName(websiteName);
				project.setWebsiteUrl(websiteUrl);
				project.setThesisType(thesisType);
				project.setThesisFilePath(thesisFilePath);
				// 是否为干细胞项目
				project.setIsStemCellProjects(isStemCellProjects);
				if ("0".equals(submitType)) {
					// 保存草稿
					project.setStatus("-1");
				} else {
					// 提交信息
					project.setStatus("0");
				}
				project.setCreateUser(user);
				project.setCreateTime(DateUtils.getDateTime());
				projectService.saveEntity(project);

				// 项目组织信息
				projectOrganization = new ProjectOrganization();
				projectOrganization.setProject(project);
				projectOrganization.setPrincipalName(principalName);
				projectOrganization
						.setPrincipaCertificateType(principaCertificateType);
				projectOrganization
						.setPrincipaCertificateNumber(principaCertificateNumber);
				projectOrganization.setPrincipaTelephone(principaTelephone);
				projectOrganization.setPrincipaPhone(principaPhone);
				projectOrganization.setPrincipaEmail(principaEmail);
				projectOrganizationService.saveEntity(projectOrganization);
				// 伦理审查信息
				projectEthic = new ProjectEthic();
				projectEthic.setName(ethicName);
				projectEthic.setIsRecords(isRecords);

				projectEthic.setProvinceCode(provinceCode);

				projectEthic.setAuditDate(auditDate);
				projectEthic.setApprovalNumber(approvalNumber);
				projectEthic.setTelephone(ethicTelephone);
				projectEthic.setEmail(ethicEmail);
				projectEthic.setApprovalFilePath(approvalFilePath);
				projectEthic.setProject(project);
				projectEthicService.saveEntity(projectEthic);

				if ("干预性研究".equals(researchType)) {
					// 组别信息 多值
					if (groupName != null && groupName.length > 0) {
						for (int i = 0; i < groupName.length; i++) {
							projectGroup = new ProjectGroup();
							projectGroup.setGroupName(groupName[i]);
							projectGroup.setGroupConditions(groupConditions[i]);
							projectGroup
									.setInterventionType(interventionType[i]);
							projectGroup
									.setInterventionMeasures(interventionMeasures[i]);
							projectGroup.setProject(project);
							projectGroupService.saveEntity(projectGroup);
						}
					}
				}

				// 主要结局指标
				projectIndicator = new ProjectIndicator();
				projectIndicator.setType("0");
				projectIndicator.setIndicatorName(indicatorNameMain);
				projectIndicator
						.setIndicatorDescription(indicatorDescriptionMain);
				projectIndicator.setIndicatorType(indicatorTypeMain);
				projectIndicator.setProject(project);
				projectIndicatorService.saveEntity(projectIndicator);
				// 次要结局指标
				if (indicatorNameMinor != null && indicatorNameMinor.length > 0) {
					for (int i = 0; i < indicatorNameMinor.length; i++) {
						projectIndicator = new ProjectIndicator();
						projectIndicator.setType("1");
						projectIndicator
								.setIndicatorName(indicatorNameMinor[i]);
						projectIndicator
								.setIndicatorDescription(indicatorDescriptionMinor[i]);
						projectIndicator
								.setIndicatorType(indicatorTypeMinor[i]);
						projectIndicator.setProject(project);
						projectIndicatorService.saveEntity(projectIndicator);
					}
				}
				// 其他结局指标
				if (indicatorNameElse != null && indicatorNameElse.length > 0) {
					for (int i = 0; i < indicatorNameElse.length; i++) {
						projectIndicator = new ProjectIndicator();
						projectIndicator.setType("2");
						projectIndicator.setIndicatorName(indicatorNameElse[i]);
						projectIndicator
								.setIndicatorDescription(indicatorDescriptionElse[i]);
						projectIndicator.setIndicatorType(indicatorTypeElse[i]);
						projectIndicator.setProject(project);
						projectIndicatorService.saveEntity(projectIndicator);
					}
				}
				// 
			}

		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}

		return "project_list";
	}

	// 审核项目变更版本信息
	public String auditProjectVersion() {
		try {
			HttpServletRequest request = ServletActionContext.getRequest();
			User user = (User) request.getSession(false).getAttribute("user");
			if (user != null) {
				// 版本表
				ProjectVersion projectVersion = projectVersionService.find(id);
				projectVersion.setVersionStatus(status);
				projectVersion.setVersionAuditReason(reason);
				projectVersion.setVersionAuditUser(user);
				if ("1".equals(status)) {
					// 查询版本相关信息
					// 项目组织信息
					List<ProjectOrganizationVersion> poVersionList = projectOrganizationVersionService
							.findByPropertys("o.projectVersion=?",
									new Object[] { projectVersion });
					// 伦理审查信息
					List<ProjectEthicVersion> peVersionList = projectEthicVersionService
							.findByPropertys("o.projectVersion=?",
									new Object[] { projectVersion });
					// 组信息
					List<ProjectGroupVersion> pgVersionList = projectGroupVersionService
							.findByPropertys("o.projectVersion=?",
									new Object[] { projectVersion });
					// 结局指标信息
					List<ProjectIndicatorVersion> piVersionList = projectIndicatorVersionService
							.findByPropertys("o.projectVersion=?",
									new Object[] { projectVersion });
					// 查询正式库，并且更新正式库
					project = projectVersion.getProject();

					project.setName(projectVersion.getName());
					project.setKeywords(projectVersion.getKeywords());
					project.setSourceType(projectVersion.getSourceType());
					project.setSourceTypeSec(projectVersion.getSourceTypeSec());
					project.setSponsors(projectVersion.getSponsors());
					project.setOrganization(projectVersion.getOrganization());
					project.setResearchPurpose(projectVersion
							.getResearchPurpose());
					project.setResearchScheme(projectVersion
							.getResearchScheme());
					project.setResearchType(projectVersion.getResearchType());
					project.setResearchDesignTimer(projectVersion
							.getResearchDesignTimer());
					project.setResearchTypeInfo(projectVersion
							.getResearchTypeInfo());
					project.setResearchDesignStart(projectVersion
							.getResearchDesignStart());
					project.setResearchDesignEnd(projectVersion
							.getResearchDesignEnd());
					project.setResearchDomain(projectVersion
							.getResearchDomain());
					project.setResearchDomainSec(projectVersion
							.getResearchDomainSec());
					project.setResearchObjectInfo(projectVersion
							.getResearchObjectInfo());
					project.setResearchObjectSample(projectVersion
							.getResearchObjectSample());
					project.setInclusionCriteria(projectVersion
							.getInclusionCriteria());
					project.setExclusionCriteria(projectVersion
							.getExclusionCriteria());
					project.setSexPreference(projectVersion.getSexPreference());
					project.setMinAge(projectVersion.getMinAge());
					project.setMaxAge(projectVersion.getMaxAge());
					project.setResearchObjectStatus(projectVersion
							.getResearchObjectStatus());
					project.setResearchObjectStart(projectVersion
							.getResearchObjectStart());
					project.setResearchObjectEnd(projectVersion
							.getResearchObjectEnd());
					project.setSampleType(projectVersion.getSampleType());
					project.setSampleInfo(projectVersion.getSampleInfo());
					project.setWebsiteName(projectVersion.getWebsiteName());
					project.setWebsiteUrl(projectVersion.getWebsiteUrl());
					project.setThesisType(projectVersion.getThesisType());
					project.setThesisFilePath(projectVersion
							.getThesisFilePath());
					projectService.updateEntity(project);

					// 项目组织信息更新
					List<ProjectOrganization> poList = projectOrganizationService
							.findByPropertys("o.project=?",
									new Object[] { project });
					if (poList.size() > 0) {
						projectOrganization = poList.get(0);
						if (poVersionList.size() > 0) {
							projectOrganization.setProject(poVersionList.get(0)
									.getProject());
							projectOrganization.setPrincipalName(poVersionList
									.get(0).getPrincipalName());
							projectOrganization
									.setPrincipaCertificateType(poVersionList
											.get(0)
											.getPrincipaCertificateType());
							projectOrganization
									.setPrincipaCertificateNumber(poVersionList
											.get(0)
											.getPrincipaCertificateNumber());
							projectOrganization
									.setPrincipaTelephone(poVersionList.get(0)
											.getPrincipaTelephone());
							projectOrganization.setPrincipaPhone(poVersionList
									.get(0).getPrincipaPhone());
							projectOrganization.setPrincipaEmail(poVersionList
									.get(0).getPrincipaEmail());
							projectOrganizationService
									.updateEntity(projectOrganization);
						}
					}

					// 伦理审查信息更新
					List<ProjectEthic> peList = projectEthicService
							.findByPropertys("o.project=?",
									new Object[] { project });
					if (peList.size() > 0) {
						projectEthic = peList.get(0);
						if (peVersionList.size() > 0) {
							projectEthic
									.setName(peVersionList.get(0).getName());
							projectEthic.setIsRecords(peVersionList.get(0)
									.getIsRecords());
							projectEthic.setProvinceCode(peVersionList.get(0)
									.getProvinceCode());
							projectEthic.setAuditDate(peVersionList.get(0)
									.getAuditDate());
							projectEthic.setApprovalNumber(peVersionList.get(0)
									.getApprovalNumber());
							projectEthic.setTelephone(peVersionList.get(0)
									.getTelephone());
							projectEthic.setEmail(peVersionList.get(0)
									.getEmail());
							projectEthic.setApprovalFilePath(peVersionList.get(
									0).getApprovalFilePath());
							projectEthic.setProject(peVersionList.get(0)
									.getProject());
							projectEthicService.updateEntity(projectEthic);
						}
					}

					// 删除组信息
					List<ProjectGroup> pgList = projectGroupService
							.findByPropertys("o.project=?",
									new Object[] { project });
					for (int i = 0; i < pgList.size(); i++) {
						projectGroupService.deleteEntity(pgList.get(i).getId());
					}
					// 新增组信息
					if (pgVersionList.size() > 0) {
						for (int i = 0; i < pgVersionList.size(); i++) {
							ProjectGroupVersion projectGroupVersion = pgVersionList
									.get(i);
							projectGroup = new ProjectGroup();
							projectGroup.setGroupName(projectGroupVersion
									.getGroupName());
							projectGroup.setGroupConditions(projectGroupVersion
									.getGroupConditions());
							projectGroup
									.setInterventionType(projectGroupVersion
											.getInterventionType());
							projectGroup
									.setInterventionMeasures(projectGroupVersion
											.getInterventionMeasures());
							projectGroup.setProject(projectGroupVersion
									.getProject());
							projectGroupService.saveEntity(projectGroup);
						}
					}

					// 删除结局信息
					List<ProjectIndicator> piList = projectIndicatorService
							.findByPropertys("o.project=?",
									new Object[] { project });
					for (int i = 0; i < piList.size(); i++) {
						projectIndicatorService.deleteEntity(piList.get(i)
								.getId());
					}
					// 新增结局信息
					if (piVersionList.size() > 0) {
						for (int i = 0; i < piVersionList.size(); i++) {
							ProjectIndicatorVersion projectIndicatorVersion = piVersionList
									.get(i);
							projectIndicator = new ProjectIndicator();
							projectIndicator.setType(projectIndicatorVersion
									.getType());
							projectIndicator
									.setIndicatorName(projectIndicatorVersion
											.getIndicatorName());
							projectIndicator
									.setIndicatorDescription(projectIndicatorVersion
											.getIndicatorDescription());
							projectIndicator
									.setIndicatorType(projectIndicatorVersion
											.getIndicatorType());
							projectIndicator.setProject(projectIndicatorVersion
									.getProject());
							projectIndicatorService
									.saveEntity(projectIndicator);
						}
					}

				}
				projectVersionService.updateEntity(projectVersion);
				super.pringWriterToPage("success");
			}

		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return null;
	}

	// 审核项目备案信息
	public String auditProject() {
		try {
			HttpServletRequest request = ServletActionContext.getRequest();
			User user = (User) request.getSession(false).getAttribute("user");
			if (user != null) {
				project = projectService.find(id);
				project.setStatus(status);
				project.setReason(reason);
				
				// 判断是否为干细胞项目
				if (("1".equals(status) && null==project.getIsStemCellProjects())
					|| 
					("1".equals(status) 
						&& null!=project.getIsStemCellProjects()
						&& null!=project.getIsProvinceManagerAudit() )
				   ) {
					System.out.println(">>> 该项目是干细胞项目或者非干细胞项目，如为干细胞项目，则进行了省级管理员审核，如是非干细胞项目，则直接修改状态更新版本！");
					
					// 如果为干细胞项目,设置isProvinceManagerAudit=1 说明经过了省级管理员审核
					if(null!=project.getIsStemCellProjects()) {
						project.setIsProvinceManagerAudit("1");
					}
					
					String regNumber = "CMR-"
							+ DateUtils.getDateNoStyle().substring(0, 8) + "-";
					LinkedHashMap<String, String> mp = new LinkedHashMap<String, String>();
					mp.put("regNumber", "desc");
					List<Project> list = projectService.findByPropertys(
							" o.status=? and o.regNumber like ? ",
							new Object[] { "1", regNumber + "%" }, mp);
					if (list.size() > 0) {
						regNumber = regNumber
								+ (Integer.parseInt(list.get(0).getRegNumber()
										.split("-")[2]) + 1);
					} else {
						regNumber = regNumber + "1001";
					}
					project.setRegNumber(regNumber); // CMR-20150308-1006

					// 同时往版本表新增记录
					ProjectVersion projectVersion = new ProjectVersion();
					projectVersion.setName(project.getName());
					projectVersion.setKeywords(project.getKeywords());
					projectVersion.setSourceType(project.getSourceType());
					projectVersion.setSourceTypeSec(project.getSourceTypeSec());
					projectVersion.setSponsors(project.getSponsors());
					projectVersion.setOrganization(project.getOrganization());
					projectVersion.setResearchPurpose(project
							.getResearchPurpose());
					projectVersion.setResearchScheme(project
							.getResearchScheme());
					projectVersion.setResearchType(project.getResearchType());
					projectVersion.setResearchDesignTimer(project
							.getResearchDesignTimer());
					projectVersion.setResearchTypeInfo(project
							.getResearchTypeInfo());
					projectVersion.setResearchDesignStart(project
							.getResearchDesignStart());
					projectVersion.setResearchDesignEnd(project
							.getResearchDesignEnd());
					projectVersion.setResearchDomain(project
							.getResearchDomain());
					projectVersion.setResearchDomainSec(project
							.getResearchDomainSec());
					projectVersion.setResearchObjectInfo(project
							.getResearchObjectInfo());
					projectVersion.setResearchObjectSample(project
							.getResearchObjectSample());
					projectVersion.setInclusionCriteria(project
							.getInclusionCriteria());
					projectVersion.setExclusionCriteria(project
							.getExclusionCriteria());
					projectVersion.setSexPreference(project.getSexPreference());
					projectVersion.setMinAge(project.getMinAge());
					projectVersion.setMaxAge(project.getMaxAge());
					projectVersion.setResearchObjectStatus(project
							.getResearchObjectStatus());
					projectVersion.setResearchObjectStart(project
							.getResearchObjectStart());
					projectVersion.setResearchObjectEnd(project
							.getResearchObjectEnd());
					projectVersion.setSampleType(project.getSampleType());
					projectVersion.setSampleInfo(project.getSampleInfo());
					projectVersion.setWebsiteName(project.getWebsiteName());
					projectVersion.setWebsiteUrl(project.getWebsiteUrl());
					projectVersion.setThesisType(project.getThesisType());
					projectVersion.setThesisFilePath(project
							.getThesisFilePath());
					projectVersion.setIsStemCellProjects(isStemCellProjects);
					projectVersion.setStatus("1");
					// 版本相关信息
					projectVersion.setVersionTime(DateUtils.getDateTime());
					// 查询版本号
					LinkedHashMap<String, String> orderby = new LinkedHashMap<String, String>();
					orderby.put("versionNumber", "desc");
					List<ProjectVersion> pvList = projectVersionService
							.findByPropertys("o.project=?",
									new Object[] { project }, orderby);
					if (pvList.size() > 0) {
						projectVersion
								.setVersionNumber((Integer.parseInt(pvList.get(
										0).getVersionNumber()) + 1)
										+ "");
					} else {
						projectVersion.setVersionNumber("1");
					}
					projectVersion.setVersionStatus("1");
					projectVersion.setProject(project);
					projectVersion.setRegNumber(project.getRegNumber());
					projectVersion.setCreateTime(project.getCreateTime());
					projectVersion.setCreateUser(project.getCreateUser());
					projectVersionService.saveEntity(projectVersion);

					// 项目组织信息
					List<ProjectOrganization> poList = projectOrganizationService
							.findByPropertys("o.project=?",
									new Object[] { project });
					if (poList.size() > 0) {
						ProjectOrganizationVersion aProjectOrganizationVersion = new ProjectOrganizationVersion();
						aProjectOrganizationVersion.setProject(poList.get(0)
								.getProject());
						aProjectOrganizationVersion
								.setProjectVersion(projectVersion);
						aProjectOrganizationVersion.setPrincipalName(poList
								.get(0).getPrincipalName());
						aProjectOrganizationVersion
								.setPrincipaCertificateType(poList.get(0)
										.getPrincipaCertificateType());
						aProjectOrganizationVersion
								.setPrincipaCertificateNumber(poList.get(0)
										.getPrincipaCertificateNumber());
						aProjectOrganizationVersion.setPrincipaTelephone(poList
								.get(0).getPrincipaTelephone());
						aProjectOrganizationVersion.setPrincipaPhone(poList
								.get(0).getPrincipaPhone());
						aProjectOrganizationVersion.setPrincipaEmail(poList
								.get(0).getPrincipaEmail());
						projectOrganizationVersionService
								.saveEntity(aProjectOrganizationVersion);
					}

					// 伦理审查信息
					List<ProjectEthic> peList = projectEthicService
							.findByPropertys("o.project=?",
									new Object[] { project });
					if (peList.size() > 0) {
						ProjectEthicVersion aProjectEthicVersion = new ProjectEthicVersion();
						aProjectEthicVersion.setName(peList.get(0).getName());
						aProjectEthicVersion.setIsRecords(peList.get(0)
								.getIsRecords());
						aProjectEthicVersion.setProvinceCode(peList.get(0)
								.getProvinceCode());
						aProjectEthicVersion.setAuditDate(peList.get(0)
								.getAuditDate());
						aProjectEthicVersion.setApprovalNumber(peList.get(0)
								.getApprovalNumber());
						aProjectEthicVersion.setTelephone(peList.get(0)
								.getTelephone());
						aProjectEthicVersion.setEmail(peList.get(0).getEmail());
						aProjectEthicVersion.setApprovalFilePath(peList.get(0)
								.getApprovalFilePath());
						aProjectEthicVersion.setProject(peList.get(0)
								.getProject());
						aProjectEthicVersion.setProjectVersion(projectVersion);
						projectEthicVersionService
								.saveEntity(aProjectEthicVersion);
					}

					// 组别信息
					List<ProjectGroup> pgList = projectGroupService
							.findByPropertys("o.project=?",
									new Object[] { project });
					if (pgList.size() > 0) {
						for (int i = 0; i < pgList.size(); i++) {
							ProjectGroup projectGroup = pgList.get(i);
							ProjectGroupVersion aProjectGroupVersion = new ProjectGroupVersion();
							aProjectGroupVersion.setGroupName(projectGroup
									.getGroupName());
							aProjectGroupVersion
									.setGroupConditions(projectGroup
											.getGroupConditions());
							aProjectGroupVersion
									.setInterventionType(projectGroup
											.getInterventionType());
							aProjectGroupVersion
									.setInterventionMeasures(projectGroup
											.getInterventionMeasures());
							aProjectGroupVersion.setProject(projectGroup
									.getProject());
							aProjectGroupVersion
									.setProjectVersion(projectVersion);
							projectGroupVersionService
									.saveEntity(aProjectGroupVersion);
						}
					}

					// 结局指标信息
					List<ProjectIndicator> piList = projectIndicatorService
							.findByPropertys("o.project=?",
									new Object[] { project });
					if (piList.size() > 0) {
						for (int i = 0; i < piList.size(); i++) {
							ProjectIndicator projectIndicator = piList.get(i);
							ProjectIndicatorVersion aProjectIndicatorVersion = new ProjectIndicatorVersion();
							aProjectIndicatorVersion.setType(projectIndicator
									.getType());
							aProjectIndicatorVersion
									.setIndicatorName(projectIndicator
											.getIndicatorName());
							aProjectIndicatorVersion
									.setIndicatorDescription(projectIndicator
											.getIndicatorDescription());
							aProjectIndicatorVersion
									.setIndicatorType(projectIndicator
											.getIndicatorType());
							aProjectIndicatorVersion
									.setProject(projectIndicator.getProject());
							aProjectIndicatorVersion
									.setProjectVersion(projectVersion);
							projectIndicatorVersionService
									.saveEntity(aProjectIndicatorVersion);
						}
					}
					
					// 
				}else {
					if("1".equals(status) && null!=project.getIsStemCellProjects()) {
						System.out.println(">>> 该项目是干细胞项目，刚才进行了机构管理员审核！");
						project.setIsProvinceManagerAudit("0");
					}else {
						project.setIsProvinceManagerAudit(null);
						System.out.println(">>> 该细胞不是干细胞项目！");
					}
				}
				projectService.updateEntity(project);
				super.pringWriterToPage("success");
			}

		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return null;
	}

	// 机构管理员查询机构用户提交信息
	public String searchVersionListByOrgUser() {
		try {
			HttpServletRequest request = ServletActionContext.getRequest();
			User user = (User) request.getSession(false).getAttribute("user");
			HashMap<String, Object> r = new LinkedHashMap<String, Object>();
			if (null == searchText || "请输入名称".equals(searchText)) {
				searchText = "";
			}
			// 返回的实体类
			List<ProjectEntity> peList = new ArrayList<ProjectEntity>();
			ProjectEntity aProjectEntity = null;
			LinkedHashMap<String, String> orderBy = new LinkedHashMap<String, String>();
			orderBy.put("regNumber", "desc");
			List<Project> pList = projectService.findByPropertys(
					"o.name like ? and o.organization=? ", new Object[] {"'%" + searchText + "%'", user.getOrganization() },
					orderBy);
			for (int i = 0; i < pList.size(); i++) {
				Project aProject = pList.get(i);
				// 版本相关
				LinkedHashMap<String, String> mp = new LinkedHashMap<String, String>();
				mp.put("versionTime", "desc");
				List<ProjectVersion> list = projectVersionService
						.findByPropertys("o.project=?",
								new Object[] { aProject }, mp);
				if (list.size() > 0
						&& "0".equals(list.get(0).getVersionStatus())) {
					aProjectEntity = new ProjectEntity();
					aProjectEntity.setId(aProject.getId());
					aProjectEntity.setName(aProject.getName());
					aProjectEntity.setRegNumber(aProject.getRegNumber());
					aProjectEntity.setCreateUser(aProject.getCreateUser());
					aProjectEntity.setCreateTime(aProject.getCreateTime());
					// 添加版本相关信息
					aProjectEntity.setIsVersion("1");
					aProjectEntity.setVersionAuditReason(list.get(0)
							.getVersionAuditReason());
					aProjectEntity.setVersionAuditUser(list.get(0)
							.getVersionAuditUser());
					aProjectEntity.setVersionId(list.get(0).getId());
					aProjectEntity.setVersionNumber(list.get(0)
							.getVersionNumber());
					aProjectEntity.setVersionStatus(list.get(0)
							.getVersionStatus());
					aProjectEntity.setVersionTime(list.get(0).getVersionTime());
					peList.add(aProjectEntity);
				}
			}

			r.put("list", peList);
			// 用户信息
			r.put("user", user);
			super.printWriterJsonToPage(JsonUtil.formatToJson(r));
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return null;
	}

	// 机构管理员查询机构用户提交信息
	public String searchListByOrgUser() {
		try {
			HttpServletRequest request = ServletActionContext.getRequest();
			User user = (User) request.getSession(false).getAttribute("user");
			HashMap<String, Object> r = new LinkedHashMap<String, Object>();
			LinkedHashMap<String, String> mp = new LinkedHashMap<String, String>();
			mp.put("createTime", "desc");
			if (null == searchText || "请输入名称".equals(searchText)) {
				searchText = "";
			}
			String searchStatusHql = "";
			if (null == searchStatus || "".equals(searchStatus)) {
				searchStatusHql = " and ( o.status='0' or o.status='1' or o.status='2' or o.status='3' ) ";
			} else {
				searchStatusHql = " and o.status='" + searchStatus + "'";
			}
			List<ProjectEntity> resultList = new ArrayList<ProjectEntity>();
			ProjectEntity aProjectEntity = null;
			List<Project> list  = null;
			// 机构管理员
			if(user.getRoleType()==2) {
				list = projectService.findByPropertys(
						"o.name like ? " + searchStatusHql
								+ " and o.organization=?", new Object[] {
								"%" + searchText + "%", user.getOrganization() },
						mp);
			// 省级管理员
			}else if(user.getRoleType()==1) {
				list = projectService.findByPropertys(
						"o.name like ? " + searchStatusHql
								+ " and o.organization.province=?", new Object[] {
								"%" + searchText + "%", user.getProvince() },
						mp);
			}
			for (int i = 0; i < list.size(); i++) {
				Project aProject = list.get(i);
				aProjectEntity = new ProjectEntity();
				aProjectEntity.setId(aProject.getId());
				aProjectEntity.setIsStemCellProjects(aProject.getIsStemCellProjects());
				aProjectEntity.setIsProvinceManagerAudit(aProject.getIsProvinceManagerAudit());
				aProjectEntity.setName(aProject.getName());
				aProjectEntity.setReason(aProject.getReason());
				aProjectEntity.setRegNumber(aProject.getRegNumber());
				aProjectEntity.setCreateTime(aProject.getCreateTime());
				aProjectEntity.setCreateUser(aProject.getCreateUser());
				aProjectEntity.setStatus(aProject.getStatus());
				
				aProjectEntity.setRoleType(user.getRoleType());
				
				// 判断是否有项目完成总结
				List<ProjectSummarize> psList = projectSummarizeService
						.findByPropertys("o.project=?",
								new Object[] { project });
				if (psList.size() > 0) {
					aProjectEntity.setIsSummarize("1"); // 已填写
				} else {
					aProjectEntity.setIsSummarize("0"); // 未填写
				}
				resultList.add(aProjectEntity);
			}
			r.put("list", resultList);
			// 查询我的项目状态
			List<String> statusList = new ArrayList<String>();
			// 全部
			list = projectService.findByPropertys(
					" o.status !=? and o.organization=?", new Object[] { "-1",
							user.getOrganization() }, mp);
			statusList.add("全部（" + list.size() + "）,");
			// 待审查 / 审核中
			list = projectService.findByPropertys(
					" o.status=? and o.organization=?", new Object[] { "0",
							user.getOrganization() }, mp);
			statusList.add("待审查 / 审核中（" + list.size() + "）,0");
			// 驳回
			list = projectService.findByPropertys(
					" o.status=? and o.organization=?", new Object[] { "3",
							user.getOrganization() }, mp);
			statusList.add("驳回（" + list.size() + "）,3");
			// 通过审查
			list = projectService.findByPropertys(
					" o.status=? and o.organization=?", new Object[] { "1",
							user.getOrganization() }, mp);
			statusList.add("通过审查（" + list.size() + "）,1");
			// 未通过审查
			list = projectService.findByPropertys(
					" o.status=? and o.organization=?", new Object[] { "2",
							user.getOrganization() }, mp);
			statusList.add("未通过审查（" + list.size() + "）,2");

			r.put("statusList", statusList);
			super.printWriterJsonToPage(JsonUtil.formatToJson(r));
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return null;
	}

	// 机构用户查询我的项目中心
	public String searchList() throws Exception {
		HttpServletRequest request = ServletActionContext.getRequest();
		User user = (User) request.getSession(false).getAttribute("user");
		HashMap<String, Object> r = new LinkedHashMap<String, Object>();
		LinkedHashMap<String, String> mp = new LinkedHashMap<String, String>();
		mp.put("createTime", "desc");
		if (null == searchText || "请输入名称".equals(searchText)) {
			searchText = "";
		}
		if (null == searchStatus) {
			searchStatus = "";
		}
		List<ProjectEntity> resultList = new ArrayList<ProjectEntity>();
		ProjectEntity aProjectEntity = null;
		List<Project> list = projectService
				.findByPropertys(
						"o.name like ? and o.status like ? and o.createUser=?",
						new Object[] { "%" + searchText + "%",
								searchStatus + "%", user }, mp);
		for (int i = 0; i < list.size(); i++) {
			Project aProject = list.get(i);
			aProjectEntity = new ProjectEntity();
			aProjectEntity.setId(aProject.getId());
			aProjectEntity.setName(aProject.getName());
			aProjectEntity.setIsStemCellProjects(aProject.getIsStemCellProjects());
			aProjectEntity.setIsProvinceManagerAudit(aProject.getIsProvinceManagerAudit());
			aProjectEntity.setReason(aProject.getReason());
			aProjectEntity.setRegNumber(aProject.getRegNumber());
			aProjectEntity.setCreateTime(aProject.getCreateTime());
			aProjectEntity.setCreateUser(aProject.getCreateUser());
			aProjectEntity.setStatus(aProject.getStatus());
			// 判断是否填写项目完成总结
			List<ProjectSummarize> psList = projectSummarizeService
					.findByPropertys("o.project=?", new Object[] { project });
			if (psList.size() > 0) {
				aProjectEntity.setIsSummarize("1"); // 已填写
			} else {
				aProjectEntity.setIsSummarize("0"); // 未填写
			}
			resultList.add(aProjectEntity);
		}
		r.put("list", resultList);
		// 查询我的项目状态
		List<String> statusList = new ArrayList<String>();
		// 全部
		list = projectService.findByPropertys(
				" o.status like ? and o.createUser=?", new Object[] { "%%",
						user }, mp);
		statusList.add("全部（" + list.size() + "）,");
		// 草稿
		list = projectService.findByPropertys(" o.status=? and o.createUser=?",
				new Object[] { "-1", user }, mp);
		statusList.add("草稿 / 未填完（" + list.size() + "）,-1");
		// 待审查 / 审核中
		list = projectService.findByPropertys(" o.status=? and o.createUser=?",
				new Object[] { "0", user }, mp);
		statusList.add("待审查 / 审核中（" + list.size() + "）,0");
		// 驳回
		list = projectService.findByPropertys(
				" o.status=? and o.organization=?", new Object[] { "3",
						user.getOrganization() }, mp);
		statusList.add("驳回（" + list.size() + "）,3");
		// 通过审查
		list = projectService.findByPropertys(" o.status=? and o.createUser=?",
				new Object[] { "1", user }, mp);
		statusList.add("通过审查（" + list.size() + "）,1");
		// 未通过审查
		list = projectService.findByPropertys(" o.status=? and o.createUser=?",
				new Object[] { "2", user }, mp);
		statusList.add("未通过审查（" + list.size() + "）,2");

		r.put("statusList", statusList);
		super.printWriterJsonToPage(JsonUtil.formatToJson(r));
		return null;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	public String getSourceType() {
		return sourceType;
	}

	public void setSourceType(String sourceType) {
		this.sourceType = sourceType;
	}

	public String getSourceTypeSec() {
		return sourceTypeSec;
	}

	public void setSourceTypeSec(String sourceTypeSec) {
		this.sourceTypeSec = sourceTypeSec;
	}

	public String getSponsors() {
		return sponsors;
	}

	public void setSponsors(String sponsors) {
		this.sponsors = sponsors;
	}

	public String getPrincipalName() {
		return principalName;
	}

	public void setPrincipalName(String principalName) {
		this.principalName = principalName;
	}

	public String getPrincipaCertificateType() {
		return principaCertificateType;
	}

	public void setPrincipaCertificateType(String principaCertificateType) {
		this.principaCertificateType = principaCertificateType;
	}

	public String getPrincipaCertificateNumber() {
		return principaCertificateNumber;
	}

	public void setPrincipaCertificateNumber(String principaCertificateNumber) {
		this.principaCertificateNumber = principaCertificateNumber;
	}

	public String getPrincipaTelephone() {
		return principaTelephone;
	}

	public void setPrincipaTelephone(String principaTelephone) {
		this.principaTelephone = principaTelephone;
	}

	public String getPrincipaPhone() {
		return principaPhone;
	}

	public void setPrincipaPhone(String principaPhone) {
		this.principaPhone = principaPhone;
	}

	public String getPrincipaEmail() {
		return principaEmail;
	}

	public void setPrincipaEmail(String principaEmail) {
		this.principaEmail = principaEmail;
	}

	public String getEthicName() {
		return ethicName;
	}

	public void setEthicName(String ethicName) {
		this.ethicName = ethicName;
	}

	public String getIsRecords() {
		return isRecords;
	}

	public void setIsRecords(String isRecords) {
		this.isRecords = isRecords;
	}

	public String getProvinceCode() {
		return provinceCode;
	}

	public void setProvinceCode(String provinceCode) {
		this.provinceCode = provinceCode;
	}

	public String getAuditDate() {
		return auditDate;
	}

	public void setAuditDate(String auditDate) {
		this.auditDate = auditDate;
	}

	public String getApprovalNumber() {
		return approvalNumber;
	}

	public void setApprovalNumber(String approvalNumber) {
		this.approvalNumber = approvalNumber;
	}

	public String getEthicTelephone() {
		return ethicTelephone;
	}

	public void setEthicTelephone(String ethicTelephone) {
		this.ethicTelephone = ethicTelephone;
	}

	public String getEthicEmail() {
		return ethicEmail;
	}

	public void setEthicEmail(String ethicEmail) {
		this.ethicEmail = ethicEmail;
	}

	public String getApprovalFilePath() {
		return approvalFilePath;
	}

	public void setApprovalFilePath(String approvalFilePath) {
		this.approvalFilePath = approvalFilePath;
	}

	public String getResearchPurpose() {
		return researchPurpose;
	}

	public void setResearchPurpose(String researchPurpose) {
		this.researchPurpose = researchPurpose;
	}

	public String getResearchScheme() {
		return researchScheme;
	}

	public void setResearchScheme(String researchScheme) {
		this.researchScheme = researchScheme;
	}

	public String getResearchType() {
		return researchType;
	}

	public void setResearchType(String researchType) {
		this.researchType = researchType;
	}

	public String getResearchDesignTimer() {
		return researchDesignTimer;
	}

	public void setResearchDesignTimer(String researchDesignTimer) {
		this.researchDesignTimer = researchDesignTimer;
	}

	public String getResearchTypeInfo() {
		return researchTypeInfo;
	}

	public void setResearchTypeInfo(String researchTypeInfo) {
		this.researchTypeInfo = researchTypeInfo;
	}

	public String[] getGroupName() {
		return groupName;
	}

	public void setGroupName(String[] groupName) {
		this.groupName = groupName;
	}

	public String[] getGroupConditions() {
		return groupConditions;
	}

	public void setGroupConditions(String[] groupConditions) {
		this.groupConditions = groupConditions;
	}

	public String[] getInterventionType() {
		return interventionType;
	}

	public void setInterventionType(String[] interventionType) {
		this.interventionType = interventionType;
	}

	public String[] getInterventionMeasures() {
		return interventionMeasures;
	}

	public void setInterventionMeasures(String[] interventionMeasures) {
		this.interventionMeasures = interventionMeasures;
	}

	public String getResearchDesignStart() {
		return researchDesignStart;
	}

	public void setResearchDesignStart(String researchDesignStart) {
		this.researchDesignStart = researchDesignStart;
	}

	public String getResearchDesignEnd() {
		return researchDesignEnd;
	}

	public void setResearchDesignEnd(String researchDesignEnd) {
		this.researchDesignEnd = researchDesignEnd;
	}

	public String getResearchDomain() {
		return researchDomain;
	}

	public void setResearchDomain(String researchDomain) {
		this.researchDomain = researchDomain;
	}

	public String getResearchDomainSec() {
		return researchDomainSec;
	}

	public void setResearchDomainSec(String researchDomainSec) {
		this.researchDomainSec = researchDomainSec;
	}

	public String getIndicatorNameMain() {
		return indicatorNameMain;
	}

	public void setIndicatorNameMain(String indicatorNameMain) {
		this.indicatorNameMain = indicatorNameMain;
	}

	public String getIndicatorDescriptionMain() {
		return indicatorDescriptionMain;
	}

	public void setIndicatorDescriptionMain(String indicatorDescriptionMain) {
		this.indicatorDescriptionMain = indicatorDescriptionMain;
	}

	public String getIndicatorTypeMain() {
		return indicatorTypeMain;
	}

	public void setIndicatorTypeMain(String indicatorTypeMain) {
		this.indicatorTypeMain = indicatorTypeMain;
	}

	public String[] getIndicatorNameMinor() {
		return indicatorNameMinor;
	}

	public void setIndicatorNameMinor(String[] indicatorNameMinor) {
		this.indicatorNameMinor = indicatorNameMinor;
	}

	public String[] getIndicatorDescriptionMinor() {
		return indicatorDescriptionMinor;
	}

	public void setIndicatorDescriptionMinor(String[] indicatorDescriptionMinor) {
		this.indicatorDescriptionMinor = indicatorDescriptionMinor;
	}

	public String[] getIndicatorTypeMinor() {
		return indicatorTypeMinor;
	}

	public void setIndicatorTypeMinor(String[] indicatorTypeMinor) {
		this.indicatorTypeMinor = indicatorTypeMinor;
	}

	public String[] getIndicatorNameElse() {
		return indicatorNameElse;
	}

	public void setIndicatorNameElse(String[] indicatorNameElse) {
		this.indicatorNameElse = indicatorNameElse;
	}

	public String[] getIndicatorDescriptionElse() {
		return indicatorDescriptionElse;
	}

	public void setIndicatorDescriptionElse(String[] indicatorDescriptionElse) {
		this.indicatorDescriptionElse = indicatorDescriptionElse;
	}

	public String[] getIndicatorTypeElse() {
		return indicatorTypeElse;
	}

	public void setIndicatorTypeElse(String[] indicatorTypeElse) {
		this.indicatorTypeElse = indicatorTypeElse;
	}

	public String getResearchObjectInfo() {
		return researchObjectInfo;
	}

	public void setResearchObjectInfo(String researchObjectInfo) {
		this.researchObjectInfo = researchObjectInfo;
	}

	public String getResearchObjectSample() {
		return researchObjectSample;
	}

	public void setResearchObjectSample(String researchObjectSample) {
		this.researchObjectSample = researchObjectSample;
	}

	public String getInclusionCriteria() {
		return inclusionCriteria;
	}

	public void setInclusionCriteria(String inclusionCriteria) {
		this.inclusionCriteria = inclusionCriteria;
	}

	public String getExclusionCriteria() {
		return exclusionCriteria;
	}

	public void setExclusionCriteria(String exclusionCriteria) {
		this.exclusionCriteria = exclusionCriteria;
	}

	public String getSexPreference() {
		return sexPreference;
	}

	public void setSexPreference(String sexPreference) {
		this.sexPreference = sexPreference;
	}

	public String getMinAge() {
		return minAge;
	}

	public void setMinAge(String minAge) {
		this.minAge = minAge;
	}

	public String getMaxAge() {
		return maxAge;
	}

	public void setMaxAge(String maxAge) {
		this.maxAge = maxAge;
	}

	public String getResearchObjectStatus() {
		return researchObjectStatus;
	}

	public void setResearchObjectStatus(String researchObjectStatus) {
		this.researchObjectStatus = researchObjectStatus;
	}

	public String getResearchObjectStart() {
		return researchObjectStart;
	}

	public void setResearchObjectStart(String researchObjectStart) {
		this.researchObjectStart = researchObjectStart;
	}

	public String getResearchObjectEnd() {
		return researchObjectEnd;
	}

	public void setResearchObjectEnd(String researchObjectEnd) {
		this.researchObjectEnd = researchObjectEnd;
	}

	public String getSampleType() {
		return sampleType;
	}

	public void setSampleType(String sampleType) {
		this.sampleType = sampleType;
	}

	public String getSampleInfo() {
		return sampleInfo;
	}

	public void setSampleInfo(String sampleInfo) {
		this.sampleInfo = sampleInfo;
	}

	public String getWebsiteName() {
		return websiteName;
	}

	public void setWebsiteName(String websiteName) {
		this.websiteName = websiteName;
	}

	public String getWebsiteUrl() {
		return websiteUrl;
	}

	public void setWebsiteUrl(String websiteUrl) {
		this.websiteUrl = websiteUrl;
	}

	public String getThesisType() {
		return thesisType;
	}

	public void setThesisType(String thesisType) {
		this.thesisType = thesisType;
	}

	public String getThesisFilePath() {
		return thesisFilePath;
	}

	public void setThesisFilePath(String thesisFilePath) {
		this.thesisFilePath = thesisFilePath;
	}

	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public ProjectEthic getProjectEthic() {
		return projectEthic;
	}

	public void setProjectEthic(ProjectEthic projectEthic) {
		this.projectEthic = projectEthic;
	}

	public ProjectGroup getProjectGroup() {
		return projectGroup;
	}

	public void setProjectGroup(ProjectGroup projectGroup) {
		this.projectGroup = projectGroup;
	}

	public ProjectIndicator getProjectIndicator() {
		return projectIndicator;
	}

	public void setProjectIndicator(ProjectIndicator projectIndicator) {
		this.projectIndicator = projectIndicator;
	}

	public ProjectReport getProjectReport() {
		return projectReport;
	}

	public void setProjectReport(ProjectReport projectReport) {
		this.projectReport = projectReport;
	}

	public ProjectSummarize getProjectSummarize() {
		return projectSummarize;
	}

	public void setProjectSummarize(ProjectSummarize projectSummarize) {
		this.projectSummarize = projectSummarize;
	}

	public ProjectOrganization getProjectOrganization() {
		return projectOrganization;
	}

	public void setProjectOrganization(ProjectOrganization projectOrganization) {
		this.projectOrganization = projectOrganization;
	}

	public String getSubmitType() {
		return submitType;
	}

	public void setSubmitType(String submitType) {
		this.submitType = submitType;
	}

	public String getRegNumber() {
		return regNumber;
	}

	public void setRegNumber(String regNumber) {
		this.regNumber = regNumber;
	}

	public String getSearchText() {
		return searchText;
	}

	public void setSearchText(String searchText) {
		this.searchText = searchText;
	}

	public String getSearchStatus() {
		return searchStatus;
	}

	public void setSearchStatus(String searchStatus) {
		this.searchStatus = searchStatus;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Integer getVersionId() {
		return versionId;
	}

	public void setVersionId(Integer versionId) {
		this.versionId = versionId;
	}

	public Integer getVersionId1() {
		return versionId1;
	}

	public void setVersionId1(Integer versionId1) {
		this.versionId1 = versionId1;
	}

	public Integer getVersionId2() {
		return versionId2;
	}

	public void setVersionId2(Integer versionId2) {
		this.versionId2 = versionId2;
	}

	public String getIsStemCellProjects() {
		return isStemCellProjects;
	}

	public void setIsStemCellProjects(String isStemCellProjects) {
		this.isStemCellProjects = isStemCellProjects;
	}
	
}
